package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.util.Objects;

@Entity
public class Zchukuxq {
    private int chukuxqId;
    private Qproductdetail prodetailId;
    private Zchuku chukuId;
    private Integer chukuNumber;
    private Integer chukuKetueinumber;
    private double chukuJg;

    @ManyToOne
    @JoinColumn(name = "prodetail_id", referencedColumnName = "prodetail_id")
    public Qproductdetail getProdetailId() {
        return prodetailId;
    }

    public void setProdetailId(Qproductdetail prodetailId) {
        this.prodetailId = prodetailId;
    }

    @Id
    @Column(name = "chukuxq_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public int getChukuxqId() {
        return chukuxqId;
    }

    public void setChukuxqId(int chukuxqId) {
        this.chukuxqId = chukuxqId;
    }

    @ManyToOne
    @JoinColumn(name = "chuku_id", referencedColumnName = "chuku_id")
    public Zchuku getChukuId() {
        return chukuId;
    }

    public void setChukuId(Zchuku chukuId) {
        this.chukuId = chukuId;
    }

    @Basic
    @Column(name = "chuku_jg", nullable = true)
    public double getChukuJg() {
        return chukuJg;
    }

    public void setChukuJg(double chukuJg) {
        this.chukuJg = chukuJg;
    }

    @Basic
    @Column(name = "chuku_number", nullable = true)
    public Integer getChukuNumber() {
        return chukuNumber;
    }

    public void setChukuNumber(Integer chukuNumber) {
        this.chukuNumber = chukuNumber;
    }

    @Basic
    @Column(name = "chuku_ketueinumber", nullable = true)
    public Integer getChukuKetueinumber() {
        return chukuKetueinumber;
    }

    public void setChukuKetueinumber(Integer chukuKetueinumber) {
        this.chukuKetueinumber = chukuKetueinumber;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Zchukuxq zchukuxq = (Zchukuxq) o;
        return chukuxqId == zchukuxq.chukuxqId &&
                Objects.equals(prodetailId, zchukuxq.prodetailId) &&
                Objects.equals(chukuId, zchukuxq.chukuId) &&
                Objects.equals(chukuNumber, zchukuxq.chukuNumber) &&
                Objects.equals(chukuKetueinumber, zchukuxq.chukuKetueinumber);
    }

    @Override
    public int hashCode() {
        return Objects.hash(chukuxqId, prodetailId, chukuId, chukuNumber, chukuKetueinumber);
    }
}
